package com.guigusuqi.act.controller;


import com.guigusuqi.act.service.ActPublishService;
import com.guigusuqi.act.dto.ActPublishQuery;
import com.guigusuqi.commonutils.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 发布活动管理 前端控制器
 * </p>
 *
 * @author suqi
 * @since 2022-03-31
 */
@RestController
@RequestMapping("/act/publish")
@Api(tags = {"wx-活动列表管理"})
public class ActPublishController
{
    @Resource
    private ActPublishService actPublishService;

    /**
     * 分页查询所有活动
     * @param current
     * @param limit
     * @param
     * @return
     */
    @ApiOperation("分页查询所有活动")
    @PostMapping("pageActPublish/{current}/{limit}")
    public Result pageActPublish(@PathVariable(value = "current",required = true) Long current,
                                 @PathVariable(value = "limit",required = true) Long limit)
    {
        return actPublishService.pageActPublish(current,limit);
    }

    /**
     * 条件分页查询所有活动
     * @param current
     * @param limit
     * @param actPublishQuery
     * @return
     */
    @ApiOperation("多条件分页查询所有活动")
    @PostMapping("pageActPublishCondition/{current}/{limit}")
    public Result pageActPublishCondition(@PathVariable(value = "current",required = true) Long current,
                                          @PathVariable(value = "limit",required = true) Long limit,
                                          @ApiParam("查询活动多条件组合")
                                          @RequestBody(required = false) ActPublishQuery actPublishQuery)
    {
        return actPublishService.pageActPublishCondition(current,limit,actPublishQuery);
    }
}

